
df=sqlContext.read.orc("/user/hive/warehouse/dw.db/sms_log")
df.registerTempTable("base")
df=sqlContext.sql("""create table hongmu.all as select * from base where
                 msg_content like '%红木%'
                 OR msg_content like '%家具%'
                 OR msg_content like '%玉石%'
                 OR msg_content like '%红酸枝%'
                 OR msg_content like '%鸡翅木%'
                 OR msg_content like '%紫檀%'
                 OR msg_content like '%黄花梨%'
                 OR msg_content like '%花梨%'
                 """)


df=sqlContext.sql("""create table hongmu.hongmujiaju_20181018 as select * from hongmu.all where
smslabel in ( "红木檀香阁",
"宏鸣轩红木家具",
"平度昌贤红木家具与李京江书法联展",
"涵香阁红木生活馆",
"攀峰红木",
"明堂红木",
"海门市永典红木",
"星卡斯红木坐垫",
"纯木阁红木",
"河海红木",
"东阳红木展",
"红木古典家具网",
"阳江红木山蠔饭店",
"御品轩红木世家",
"海天世纪红木文化楼",
"振宇红木",
"静雅轩红木工艺坊",
"红木商场",
"红木家具",
"大型红木展销会",
"金鼎红木双12",
"国民放心的红木品牌",
"铭可轩红木",
"御兴红木",
"如意红木家具厂",
"麒麟红木制品协会",
"新坐标红木坐垫",
"根发红木官方店",
"永丰红木馆",
"红木汇",
"似锦传承红木工艺",
"森世界红木家具",
"胜联红木城",
"康泓红木家具",
"金鼎红木",
"韩酷时尚红木茶桌",
"阿呆红木批发",
"龍發红木艺术馆",
"弘鑫红木家具",
"原木阁精品红木",
"红木",
"和木堂红木家具馆",
"红木城",
"东阳红木城",
"阳江地天泰红木馆",
"中信红木",
"顺泰轩红木",
"平度昌贤红木家具",
"大型红木城")""")

df=sqlContext.sql("""create table bitcoin.recent as select * from bitcoin.all ORDER BY insert_time DESC limit 300000
                 """)

